{extend name="../../admin/view/main"}
{block name="button"}
<!--{if auth("coupon")}-->
<button class='layui-btn layui-btn-sm' data-queue='{:url("coupon")}' data-confirm="真的要全量更新优惠券吗？">全量更新优惠券</button>
<!--{/if}-->
{/block}
{block name='content'}
<div class="think-box-shadow">
    {include file='coupon/index_search'}
    <table class="layui-table margin-top-10" lay-skin="line">
        {notempty name='list'}
        <thead>
        <tr>
            <th class="text-left nowrap">编号</th>
            <th class="text-left">优惠券ID</th>
            <th class="text-left">店铺ID</th>
            <th class="text-left">名称</th>
            <th class="text-left nowrap">条件</th>
            <th class="text-left nowrap">有效期</th>
            <th class="text-left" style="width: 150px;">商品ID</th>
            <th class="text-left nowrap">状态</th>
        </tr>
        </thead>
        {/notempty}
        <tbody>
        {foreach $list as $key=>$vo}
        <tr>
            <td class="text-left nowrap">{$vo.id}</td>
            <td class="text-left nowrap">{$vo.coupon_id}</td>
            <td class="text-left nowrap">{$vo.shop_appid}</td>
            <td class="text-left">{$vo.title}</td>
            <td class="text-left nowrap">{$vo.condition}</td>
            <td class="text-left nowrap">{$vo.end_time|format_datetime}</td>
            <td class="text-left">{$vo.product_ids}</td>
            <td class="text-left nowrap">
                {if $vo.show eq 0}
                <span>无效</span>
                {else}
                <span class="color-red">领取中</span>
                {/if}
            </td>
        </tr>
        {/foreach}
        </tbody>
    </table>
    {empty name='list'}<span class="notdata">没有记录哦</span>{else}{$pagehtml|raw|default=''}{/empty}
</div>
{/block}